//
//  SDMineHeaderView.m
//  skinDetection
//
//  Created by  liangzhun on 2018/10/30.
//  Copyright © 2018年  liangzhun. All rights reserved.
//

#import "SDMineHeaderView.h"

@implementation SDMineHeaderView


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
    
    self.nickName.text = SDAppDelegate.userModel.nickName;
    NSString *imageSex = SDAppDelegate.userModel.sex == 0?@"男":@"女";
    self.headerPhoto.layer.cornerRadius = 40;
    self.headerPhoto.layer.masksToBounds = YES;
    
    [self.headerPhoto sd_setImageWithURL:[NSURL URLWithString:SDAppDelegate.userModel.headImage] placeholderImage:[UIImage imageNamed:@"组 7"]];
    self.genderImage.image = [UIImage imageNamed:imageSex];
     
}

//- (void)addLayer
//{
//   CAGradientLayer *bgLayer = [[CAGradientLayer alloc] init];
//    bgLayer.colors = @[(__bridge id)RGBA(255, 120, 155, 0.45).CGColor,(__bridge id)RGBA(250, 207, 92, 0.45).CGColor];
//    bgLayer.locations = @[@0.5,@1];
//    bgLayer.startPoint = CGPointMake(0, 0);
//    bgLayer.endPoint = CGPointMake(1, 0.8);
//    bgLayer.frame = CGRectMake(0, 0, SDMainScreenWidth, 155*SDWidth375Scale + 59);
//    [self.layerView.layer insertSublayer:bgLayer above:0];
//    
//}
@end
